#pragma once
#include "util/noncopyable.h"
#include "base/config.h"

#include <vector>
namespace net_tools::base
{
  class Channel;
  class Epoll;
  class Channelpool : util::noncopyable
  {
  public:
    Channelpool(Epoll *epoll, int size = _C::CHANNEL_DEFAULT_SIZE);
    ~Channelpool(){};
    Channel *Get_Channel(int fd);
    void Free_Channel(Channel *old_Channel);

  private:
    std::vector<Channel *> channel_free_vector;
    Epoll *epoll_;
  };

} // namespace net_tools::base